package com.fxkj.cloud.drms.domain.mqtt;

import com.fxkj.cloud.dbs.common.model.DeviceBasicInfo;
import lombok.Getter;

import java.util.List;
import java.util.UUID;

/**
 * <p>description: 指令领域实体</p>
 * @author ww
 * @date 2025/3/25 10:22
 */
@Getter
public class CommandDomain {
    private final UUID commandId;
    private final DeviceBasicInfo deviceBasicInfo;
    private final List<CommandKv> commandKvs;
    private final String username;

    private CommandDomain(UUID commandId, DeviceBasicInfo deviceBasicInfo, List<CommandKv> commandKvs, String username) {
        this.commandId = commandId;
        this.deviceBasicInfo = deviceBasicInfo;
        this.commandKvs = commandKvs;
        this.username = username;
    }

    public static CommandDomain create(DeviceBasicInfo deviceBasicInfo, List<CommandKv> commandKvs, String username) {
        return new CommandDomain(UUID.randomUUID(), deviceBasicInfo, commandKvs, username);
    }

    public static CommandDomain create(UUID commandId, DeviceBasicInfo deviceBasicInfo, List<CommandKv> commandKvs, String username) {
        return new CommandDomain(commandId, deviceBasicInfo, commandKvs, username);
    }

}
